﻿
using IWshRuntimeLibrary;
using System.Diagnostics;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            WshShell shell = new WshShell();
            string a = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            string shortcutAddress = "C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\reboot.exe.lnk";
            IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(shortcutAddress);
            Debug.WriteLine(a);
            Debug.WriteLine("===============================");
            shortcut.TargetPath = a+"\\reboot.exe";
            shortcut.WorkingDirectory = a;
            shortcut.Save();
        }
    }
}
